//
//  StarredChannelsCollectionViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/8/30.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "StarredChannelsCollectionViewCell.h"
#import "HomeChannels.h"
#import "HomeJoin.h"
#import "UIImageView+WebCache.h"
@interface StarredChannelsCollectionViewCell ()


@end



@implementation StarredChannelsCollectionViewCell


- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        
    }
    return self;
}


- (void)setHomeChannel:(HomeChannels *)homeChannel {
    _homeChannel = homeChannel;
    
    _getChannelTitleLabel.text = _homeChannel.content;
    _getChannelContentLabel.text = _homeChannel.desc;
    [_getChannelImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _homeChannel.img]]];
    // 图片适应尺寸
    _getChannelImageView.contentMode = UIViewContentModeScaleAspectFill;
    _getChannelImageView.layer.masksToBounds = YES;
    if (_homeChannel.join.status == 3) {
        _getChannelTypeImageView.image = [UIImage imageNamed:@"channelCamera"];
    } else if (_homeChannel.join.status == 2) {
        _getChannelTypeImageView.image = [UIImage imageNamed:@"channelVoice"];
    } else {
        _getChannelTypeImageView.image = [UIImage imageNamed:@"editAddress"];
    }
#warning 小红点消失
    if (_homeChannel.newCount == 0) {
        _hasNewPostImageView.hidden = YES;
    } else {
        _hasNewPostImageView.hidden = NO;
    }
    
    
    
}





/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
